// global dependencies
import 'dayjs'
import 'react'
import 'react-dom'

if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register('sw.js').then(() => {
        console.info('注册成功')
      }).catch((err) => {
        console.error('注册失败')
      })
    await navigator.serviceWorker.ready;
    const launch = async () => {
        await import('./src/main.js');
    };
    if (navigator.serviceWorker.controller) {
        await launch();
    } else {
        navigator.serviceWorker.addEventListener('controllerchange', launch)
    }
}